/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.soa.service.busi.pl;

import com.lianzt.commondata.AbstractCommonData;
import com.lianzt.factory.AESFactory;
import com.soa.exception.GlobalException;
import com.soa.service.BaseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * P11003
 * @author gdk
 */
@Service
public class ResetUserPsw extends BaseService {

    private final Logger log = LoggerFactory.getLogger(ResetUserPsw.class);

    @Override
    public String[] keys() {
        return null;
    }

    @Override
    @Transactional
    public void execute(AbstractCommonData in, AbstractCommonData inHead, AbstractCommonData out, AbstractCommonData outHead) {
        String resetPwsString = "123123";
        String username = in.getStringValue("username");
        try {
            resetPwsString = AESFactory.encryptString(resetPwsString);
        } catch (Exception e) {
            throw new GlobalException(100002, e);       //加密算法异常
        }
        update("reset_user_psw", resetPwsString,username);
    }
}
